import { UserEntity } from "@/api/system/user";
import { ref } from "vue";

export function useEvaluationUser() {
  /**
   * 待评价用户列表
   */
  const appraiseUserList = ref<UserEntity[]>([]);

  /**
   * 是测评烈性
   */
  const isEvaluated = ref(false);

  /**
   * 获取评价tablesrow
   */
  const getAppraiseTableRows = () => {
    return (
      appraiseUserList.value!.map(item => {
        return {
          id: item.id,
          label: item.nickName || item.userName
        };
      }) || []
    );
  };

  return {
    appraiseUserList,
    getAppraiseTableRows,
    isEvaluated
  };
}

export const evaluationUser = useEvaluationUser();
